package com.xyy.saas.payment.cores.enums;

import java.util.HashMap;
import java.util.Map;

public enum FbankTradeCodeEnum {

    FTC_1(1, "直接支付T0"),
    FTC_2(2, "会员冻结"),
    FTC_3(3, "在途充值撤销"),
    FTC_4(4, "在途充值"),
    FTC_5(5, "冻结充值撤销"),
    FTC_6(6, "见证+收单退款"),
    FTC_7(7, "见证+收单资金流水"),
    FTC_7_1(71, "见证+收单资金流水（退款）"),
    FTC_8(8, "见证+收单资金冻结"),
    FTC_9(9, "见证+收单充值"),
    FTC_10(10, "冻结充值"),
    FTC_11(11, "会员间交易退款"),
    FTC_12(12, "可提现解冻"),
    FTC_13(13, "分账"),
    FTC_14(14, "分账撤销"),
    FTC_15(15, "提现"),
    FTC_16(16, "支付到平台"),
    FTC_17(17, "登记挂账"),
    FTC_18(18, "绑卡匹配入金"),
    FTC_19(19, "资金归集"),
    FTC_20(20, "可提现冻结"),
    FTC_21(21, "会员解冻"),
    FTC_22(22, "见证+收单退款撤销"),
    FTC_23(23, "平安挂账子账户清算给商户"),
    FTC_24(24, "资方交易T0"),

    FTC_99(99, "未知交易"),

    // 京东渠道交易
    FTC_30(30, "京东渠道交易"),

    ;

    private final int code;
    private final String desc;

    FbankTradeCodeEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static Map<String, Integer> maps = new HashMap<>();
    public static final Map<Integer, String> code2DescMap = new HashMap<>();

    static {
        for (FbankTradeCodeEnum value : FbankTradeCodeEnum.values()) {
            maps.put(value.desc, value.code);
            code2DescMap.put(value.code, value.desc);
        }
    }

    public Integer getCodeByDesc(String desc) {
        return maps.get(desc);
    }

    public int getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

}
